package com.uinfor.controller;

import com.uinfor.entity.Payment;
import com.uinfor.entity.Result;
import org.bouncycastle.cms.PasswordRecipientId;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @descripttion:
 * @Author: WZH
 * @Date :2021/2/3  11:08
 **/
@RestController
public class TestController {
    @Value("${server.port}")
    private String serverPort;


    public static HashMap<Long, Payment> hashMap=new HashMap<>();
    static {
        hashMap.put(1L,new Payment(1L,"ASDADADAD"));
        hashMap.put(2L,new Payment(2L,"A23DSADADA"));
        hashMap.put(3L,new Payment(3L,"123214SDADA"));
        hashMap.put(4L,new Payment(4L,"LFDSAGHLFQ"));
    }

    @GetMapping("/payment/{id}")
    public Result<Payment> paymentSql(@PathVariable("id")Long id){
        Payment payment = hashMap.get(id);
        return new Result<>(200,"form mysql .servort:"+serverPort,payment);
    }
}
